<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>JS04</title>
    </head>
    <body>


        <script>

           function f1(){
               {
                   var k = 9;
                   let s = 8;
               }
               console.log(k);
               console.log(s);
           }

           //f1();

           function f2(){
               var s1 = 1;
               var s1 = 2;

               let s2 = 3;
               //let s2 = 6;
           }

           //f2();

           console.log(m);// 等同于 var m; console.log(m);
           var m = 88;

           //console.log(x);
           //let x = 99;

           //const y = 9;
           //y=9;

           //箭头函数
           const fn1 = function(){
                console.log("fn1===>");
           };
           fn1();

           const fn2 = ()=>{
                console.log("fn2===>");
           };
           fn2();


           let obj = {
               n:888,
               fun(){
                    console.log("1. 属性n="+this.n+",this="+this);
                    const innerFun = function(){
                        console.log("2. 属性n="+this.n+",this="+this);
                    };
                    innerFun();
                    
                    const innerFun2 = ()=>{
                        console.log("3. 属性n="+this.n+",this="+this);
                    };
                    innerFun2();

               }
           };
           obj.fun();

            
        </script>



    </body>


</html>